5.1.2 建立提款數位幣至任意錢包(商家自訂匯率)
#簡要描述: 將數位幣提現到錢包的提現業務接口,讓用戶能夠將 usdt 轉移到指定的錢包地址 (商家自訂匯率,需登入商家後台設定)
- 要求方式: POST
- 請求介面: https://网关域名/wallet-trade-merchant/v1/pay/blockchain/custom/rate/create
- 請求媒體類型( JSON 資料格式 )Content-Type: application/json
請求參數
| 參數名稱 | 類型 | 必填 | 參數意義 | 參數說明 |
|---|---|---|---|---|
key | string | 是 | 商家 key | apiKey |
localOrderId | string | 是 | 商家平臺本地訂單號碼 | 商家平臺本地產生唯一訂單號碼 |
localUserId | string | 否 | 商家平臺本機使用者ID | 商家平臺本機使用者ID |
notifyUrl | string | 否 | 回呼位址 | 下單成功後,由 API 回呼請求通知商家的位址 (回調詳情說明在最下方) |
successRedirectUrl | string | 否 | 位址 | 成功後自動跳轉位址 |
currency | string | 是 | 幣種 | 訂單幣種 |
network | string | 是 | 主網 | 主網(目前僅支援TRON、BSC、POLYGON、ETHEREUM) |
address | string | 是 | 提款位址 | 提款位址 |
quoteCurrency | string | 是 | 訂單報價幣種 | 訂單報價幣種(需登入商家後台設定報價幣種匯率) |
quoteAmount | string | 是 | 報價金額 | 報價金額 |
isBlockchain | boolean | 否 | 是否回傳區塊鏈資訊(預設false) | 當為true時,回呼請求會攜帶訂單鏈上交 易資訊 |
expireSecond | Long | 否 | 過期時間戳記(秒) | |
sign | string | 是 | 簽章 | 詳情請見簽章演算法 |
請求 json 範例
{
"key": "9yUreYgTRtit39Dy",
"localOrderId":"conantest0128",
"localUserId":"996",
"currency":"USDT",
"network":"TRON",
"address":"TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"quoteCurrency":"CNY",
"quoteAmount":"20",
"sign":"f0ef4f925b899734727b77975ff9c0a3"
}
回應 json 範例
{
"code": 0,
"success": true,
"message": null,
"data": {
"orderId": 473228783386885,
"localUserId": "996",
"localOrderId": "conantest0128",
"orderType": "WITHDRAW",
"orderBizType": "WITHDRAW_ANY_DIGITAL_WALLET",
"targetType": "EXTERNAL",
"network": "TRON",
"address": "TPutFhYUQnrRxHSmKVwjp55vgk9QY6r5nS",
"currency": "CNY",
"userCurrency": "USDT",
"amount": "20",
"userAmount": "20",
"userReceivableAmount": "20",
"rate": "1",
"rateExpression": "1USDT≈1CNY"
}
}
回應data 參數說明
| 參數名稱 | 類型 | 參數意義 | 備註 |
|---|---|---|---|
orderId | string | 訂單 ID | |
localUserId | string | 商家本地用戶 ID | |
localOrderId | string | 商家本地訂單號碼 | |
orderType | enum | 訂單類型 | PAYMENT:支付订单 | WITHDRAW:提款订单 |
orderBizType | enum | 訂單業務類型 | orderBizType 類型說明如下 |
targetType | enum | 目標類型 | targetType 類型說明如下 |
network | string | 主網類型 | |
address | string | 位址 | 鏈上收款位址 |
currency | string | 訂單幣種 | |
userCurrency | string | 到帳幣種 | |
amount | string | 訂單金額 | |
userAmount | string | 用戶實收金額 | |
userReceivableAmount | string | 用戶應收金額 | |
rate | string | 匯率 | |
rateExpression | string | 匯率表達式 |
orderBizType 類型說明:
1、PAYMENT_WALLET_SCAN MINPAY錢包掃碼支付 2、PAYMENT_TRANSFER 數位幣綁定地址直充 3、PAYMENT_ANY_DIGITAL_SCAN 數位幣任意金額掃碼支付 4、WITHDRAW_WALLET 提款至MINPAY錢包 5.WITHDRAW_ANY_DIGITAL_WALLET 提款數位幣至任意錢包 6、PAYMENT_FIXED_DIGITAL_SCAN 數位幣限定金額掃碼支付 7、BATCH_PAY 大量代付
targetType 類型說明:
1、INTERNAL 內部位址 2、EXTERNAL 外部位址 3、USER 使用者抽象位址
回呼詳情說明
回呼的方式是:POST application/json
回呼參數 json 化範例
{
"amount":"10",
"bizType":"WITHDRAW_ANY_DIGITAL_WALLET",
"currency":"CNY",
"extra":{
"quoteAmount":"10",
"quoteCurrency":"CNY",
"quotePrice":"1"
},
"localOrderId":"conantest0132",
"merchantActualAmount":"94.63",
"merchantCurrency":"CNY",
"merchantId":302992856974,
"merchantPaidAmount":"66.84",
"merchantUserId":"996",
"notifyTime":1772266852130,
"orderCreateTime":1772266745032,
"orderId":"473284157243653",
"status":"SUCCESS",
"type":"WITHDRAW",
"userAmount":"8.5",
"userCurrency":"USDT",
"userMinerFee":"1.5",
"userReceivableAmount":"10",
"sign":"78ef83b365e77c66b0cc3a283f8ebae4",
"key":"9yUreYgTRtit39Dy"
}
| 參數名稱 | 類型 | 參與簽名 | 參數意義 | 參數說明 |
|---|---|---|---|---|
amount | decimal | 是 | 訂單金額 | |
bizType | enum | 是 | 訂單類型 | bizType 類型說明如下 |
currency | String | 是 | 幣種 | |
key | String | 是 | 商家 key | |
localOrderId | String | 是 | 本地訂單號碼 | |
merchantActualAmount | decimal | 是 | 商家實際收款金額 | |
merchantCurrency | String | 是 | 商家收款幣種 | 預設幣種 |
merchantId | String | 是 | 商家號碼 | |
merchantPaidAmount | decimal | 是 | 商家收款金額 | |
merchantUserId | String | 是 | 用戶 id | |
notifyTime | long | 是 | 回呼時間 | |
orderCreateTime | long | 是 | 訂單建立時間 | |
orderId | String | 是 | 訂單號碼 | |
status | String | 是 | 付款狀態 | |
type | String | 是 | 訂單類型 | PAYMENT:支付 WITHDRAW:提款 |
userAmount | decimal | 是 | 用戶付款金額 | |
userCurrency | String | 是 | 用戶支付幣種 | |
sign | String | 否 | md5 簽章 | 詳情看簽名演算法 |
extra | object | 是 | 包含一下參數 | |
| └quoteAmount | number | 是 | 訂單報價金額 | |
| └quoteCurrency | number | 是 | 訂單報價幣種 | |
| └quotePrice | string | 是 | 訂單報價價格 | |
userMinerFee | String | 是 | 礦工費 | 提款礦工費 |
userReceivableAmount | String | 是 | 用戶應收金額 | 用戶應收金額 |
blockchain | object | 是 | 鏈交易資訊 | 當下單請求參數isBlockchain為true,回呼請求會攜帶此物件資訊。 (只涉及鏈上交易時,isBlockchain參數會生效) |
| └network | String | 是 | 主網 | |
| └receiverAddress | String | 是 | 接收位址 | |
| └senderAddress | decimal | 是 | 傳送位址 | |
| └txId | String | 是 | 交易ID |
bizType 類型說明:
1、PAYMENT_WALLET_SCAN MINPAY錢包掃碼支付 2、PAYMENT_TRANSFER 數位幣綁定地址直充 3、PAYMENT_ANY_DIGITAL_SCAN 數位幣任意金額掃碼支付 4、WITHDRAW_WALLET 提款至MINPAY錢包 5.WITHDRAW_ANY_DIGITAL_WALLET 提款數位幣至任意錢包 6、PAYMENT_FIXED_DIGITAL_SCAN 數位幣限定金額掃碼支付 7、BATCH_PAY 大量代付
當您收到回呼通知後,請在處理完成後直接返回字串 success,表示已成功接收並處理該訊息。 系統在收到 success 回應後,將不再對該筆回呼進行重複發送。 若未收到期望回應(未回傳 success 或回傳異常),系統將依照階梯式重試機制重新傳送回呼通知,最多重試 14 次。 當前重試時間間隔依序為: 15s, 15s, 30s,180s, 600s, 1200s, 1800s, 1800s, 1800s,3600s,10800s,10800s,21600s, 21600s